package com.study.design.pattern.pattern.behavioral.observer.spring;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @Author: gongsl
 * @Date: 2025-03-23 23:52
 * @description: 监听器-股票分析师
 */
@Component
public class StockAnalyst {
    @EventListener
    public void handleStockChangeEvent(StockChangeEvent event) {
        System.out.println("StockAnalyst: 股市变化通知 -> 旧股价: $" + event.getOldStockPrice()
                + ", 新股价: $" + event.getNewStockPrice());
    }
}
